package com.berwin.syncer.entity;

import com.alibaba.fastjson.JSONObject;

public class SharedText {

    private String sender;
    private String content;

    public SharedText(String sender, String content) {
        this.sender = sender;
        this.content = content;
    }

    public String getSender() {
        return sender;
    }

    public void setSender(String sender) {
        this.sender = sender;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public JSONObject toJSONObject() {
        JSONObject obj = new JSONObject();
        obj.put("sender", this.sender);
        obj.put("content", this.content);
        return obj;
    }

    public static SharedText parseFromJSONObject(JSONObject obj) {
        return new SharedText(obj.getString("sender"), obj.getString("content"));
    }
}
